const app = getApp();

var data = {
  xhx_images: app.xhx_images,
  xhx_route: app.xhx_route,
};

var currentPage = {
  data,
  onLoad,
  getDetail,
};

var page = Object.assign({}, currentPage);

Page(page);

function onLoad(options) {
  const that = this;
  var param = { id: options.id, scheduleType:options.type};
  that.getDetail(param);
}

// 获取详情
function getDetail(param) {
  const that = this;
  app.middleware.requestAjax({
    serAddr: app.serAddrs.getMatchDetail,
    data: param,
    cancelToast: true,
    success: function (res) {
      that.setData({
        detailedRules: res.data.matchRule.detailedRules
      })
    },
    fail: function (res) {
      app.middleware.showToast(res && res.msg || "加载失败");
    }
  })
}
